package com.jwthhealth_pub.old.heartscreen.view;

import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.ScrollView;
import android.widget.TextView;

import com.jwthhealth_pub.R;
import com.jwthhealth_pub.common.view.TitleLayout;
import com.jwthhealth_pub.old.common.Constant;
import com.jwthhealth_pub.old.heartscreen.module.HeartScreenModule;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/1/17.
 */
public class HeartSceenAnswerActivity extends Activity {
    @BindView(R.id.tv_describe_value)
    TextView tvGradeDescribe;
    @BindView(R.id.tv_case_value)
    TextView tvCaseDescribe;
    @BindView(R.id.sign_topbar)
    TitleLayout signTopbar;
    @BindView(R.id.scrollView)
    ScrollView scrollView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_heartscreenanswer);
        ButterKnife.bind(this);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        }

        initTop();
        initData();
    }

    private void initData() {
        //获取数据
        HeartScreenModule module = (HeartScreenModule) getIntent().getExtras().getSerializable(Constant.HEARTSCREENINGDATA);
        tvGradeDescribe.setText(module.getData().getDesc());
        tvCaseDescribe.setText(module.getData().getSport());
    }

    private void initTop() {
        signTopbar.setOnTitleLayoutListener(new TitleLayout.TitleLayoutListener() {
            @Override
            public void leftclick() {
                finish();
            }

            @Override
            public void leftTextClick() {

            }

            @Override
            public void rightclick() {

            }

            @Override
            public void rightTextClick() {

            }
        });
    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        scrollView.fullScroll(ScrollView.FOCUS_UP);
    }
}
